package edu.cuit.zhuyimeng.aircraft.controller.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * 飞机信息VO
 */
@Data
@Schema(description = "飞机信息VO")
public class AircraftInfoVO implements Serializable {

    /**
     * 飞机型号
     */
    @Schema(description = "飞机型号")
    private String model;

    /**
     * 航空公司ID
     */
    @Schema(description = "航空公司ID")
    private Integer airlineId;

    /**
     * 航空公司简称
     */
    @Schema(description = "航空公司简称")
    private String airlineSimpleName;

    /**
     * 航空公司全称
     */
    @Schema(description = "航空公司全称")
    private String airlineFullName;

    /**
     * 航空公司两位代码
     */
    @Schema(description = "航空公司两位代码")
    private String airlineCode;

    /**
     * 飞机ID
     */
    @Schema(description = "飞机ID")
    private Long id;

    /**
     * 飞机是否锁定
     */
    @Schema(description = "飞机是否锁定")
    private Boolean isLocked;

    /**
     * 飞机状态
     */
    @Schema(description = "飞机状态")
    private String status;

    /**
     * 飞机LOGO
     */
    @Schema(description = "飞机LOGO")
    private String logo;

    /**
     * 飞机座位数
     */
    @Schema(description = "飞机座位数")
    private Integer capacity;

    @Serial
    private static final long serialVersionUID = 1L;

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        //生成Builder类 构建包含所有变量的构建者模式

        private String model;
        private Integer airlineId;
        private String airlineSimpleName;
        private String airlineFullName;
        private Long id;
        private Boolean isLocked;
        private String status;
        private String logo;
        private Integer capacity;
        private String airlineCode;

        public Builder model(String model) {
            this.model = model;
            return this;
        }

        public Builder airlineId(Integer airlineId) {
            this.airlineId = airlineId;
            return this;
        }

        public Builder airlineSimpleName(String airlineSimpleName) {
            this.airlineSimpleName = airlineSimpleName;
            return this;
        }

        public Builder airlineFullName(String airlineFullName) {
            this.airlineFullName = airlineFullName;
            return this;
        }

        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public Builder isLocked(Boolean isLocked) {
            this.isLocked = isLocked;
            return this;
        }

        public Builder status(String status) {
            this.status = status;
            return this;
        }

        public Builder logo(String logo) {
            this.logo = logo;
            return this;
        }

        public Builder capacity(Integer capacity) {
            this.capacity = capacity;
            return this;
        }

        public Builder airlineCode(String airlineCode) {
            this.airlineCode = airlineCode;
            return this;
        }

        public AircraftInfoVO build() {
            AircraftInfoVO aircraftInfoVO = new AircraftInfoVO();
            aircraftInfoVO.setModel(model);
            aircraftInfoVO.setAirlineId(airlineId);
            aircraftInfoVO.setAirlineSimpleName(airlineSimpleName);
            aircraftInfoVO.setAirlineFullName(airlineFullName);
            aircraftInfoVO.setId(id);
            aircraftInfoVO.setIsLocked(isLocked);
            aircraftInfoVO.setStatus(status);
            aircraftInfoVO.setLogo(logo);
            aircraftInfoVO.setCapacity(capacity);
            aircraftInfoVO.setAirlineCode(airlineCode);
            return aircraftInfoVO;
        }
    }
}
